<!-- 物流信息页面 -->
<template>
	<view class="container">
		<view class="header">
			<image src="../static/images/213123.png" mode=""></image>
			<view class="info">
				<text class="a" v-if="data.order">{{data.order.delivery_name||''}}</text>
				<text class="b" v-if="data.order">运单号 : {{data.order.delivery_id||''}}</text>
			</view>
		</view>
		<view class="expressInfo" v-if="data.express">
			<view :class="index == 0?'act':''" class="item" v-for="(item,index) in data.express.data" :key="index">
				<view :class="index == 0?'active':''" class="left"></view>
				<view class="right">
					<text class="a">{{item.context}}</text>
					<text class="b">{{item.time}}</text>
				</view>
			</view>
		</view>
		<empty v-if="data.express&&data.express.data.length == 0" :custom="true" src="/static/images/public/no-bill.png" text="暂无物流信息"></empty>
	</view>
</template>

<script>
	import {
		orderExpress,
		signExpress
	} from '@/api/mall.js'
	export default {
		data() {
			return {
				data: {}
			};
		},
		onLoad(options) {
			uni.showLoading({
				mask:true
			})
			if (options.type) {
				signExpress(options.id).then(res => {
					this.data = res.data
					uni.hideLoading()
				})
			} else {
				orderExpress(options.id).then(res => {
					this.data = res.data
					uni.hideLoading()
				})
			}
		},
		methods: {
		},
	}
</script>

<style lang="scss" scoped>
	.container{
		.header{
			padding: 0 30rpx;
			height: 176rpx;
			border-bottom: 20rpx solid #eee;
			display: flex;
			align-items: center;
			image{
				width: 100rpx;
				height: 100rpx;
				margin-right: 20rpx;
			}
			.info{
				color: #333;
				display: flex;
				flex-direction: column;
				justify-content: center;
				.a{
					font-size: 28rpx;
					font-weight: bold;
				}
				.b{
					margin-top: 10rpx;
					font-size: 24rpx;
				}
			}
		}
		.expressInfo{
			padding: 0 30rpx 30rpx;
			.item{
				margin-top: 56rpx;
				display: flex;
					color: #868686;
				.left{
					margin-top: 6rpx;
					border-radius: 50%;
					width: 20rpx;
					height: 20rpx;
					border: 1rpx solid #ddd;
					box-sizing: border-box;
				}
				.active{
					border: none;
					background-color: #FB3737;
				}
				.right{
					margin-left: 30rpx;
					width: 640rpx;
					display: flex;
					flex-direction: column;
					.a{
						text-align: justify;
						font-size: 22rpx;
					}
					.b{
						margin-top: 20rpx;
						font-size: 20rpx;
					}
				}
			}
			.act{
				color: #FB3737!important;
			}
		}
		
	}
	/deep/.empty-content {
		top: 196rpx!important;
	}
</style>
